<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
       /* function add(a){
             console.log("add");
                console.log("fn1");
                  var fn2 = function(c){
                    console.log("fn2");
                    return a + b + c;
                  }
                 return fn2;
              return fn1;
            } */
/* 
            var fn1 = add(1);
             var fn2 =  fn1(2);
          var res =  fn2(3);
          console.log(res);
 */

         /*   var res =  add(1)(2)(3);
         console.log(res); */
/*          function fn(num){
        if(num==1 || num==2){
            return 1;
        }
        return fn(num-1) + fn(num-2);
    }
   var res =  fn(8);
   console.log(res); */
   /* var obj = {
            arr:["张三","李四","王五"],
            name:"王小二",
            age:20,
            height:"178cm",
            fn:function(){
                console.log("姓名是"+obj.name+"年龄是"+obj.age+"身高是"+obj.height)
            }
        }
        for(var key in obj){
  if(key=="arr"){
            for(var i=0;i<obj.arr.length;i++){

console.log(obj.arr[i])
           


        }
    }
       {

       } obj.fn();
    } */
    function fn(a,b){
        var arr = new Array()
for(i=a;i<=b;i++){
   
    if(i%2==0){

arr.push(i)
    }

}
return arr


    }
  var res=  fn(20,30)
console.log(res)
    </script>
</body>
</html>